package cloudgamemysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/8/5 13:06
*/

// CGRoleApi 角色接口表（记录某个角色绑定哪些api）
type CGRoleApi struct {
	ID        int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	RoleID    int64          `json:"role_id" gorm:"column:role_id;type:bigint;not null;default:0;comment:角色ID"`
	ApiID     int64          `json:"api_id" gorm:"column:api_id;type:bigint;not null;default:0;comment:接口ID"`
	CreatedAt time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGRoleApi) TableName() string {
	return "cg_role_api"
}
